Adding Edge Compute
You can configure multiple edge compute functions within your service. Each function is associated with a list of routes, where each route consists of a domain and a path pattern.
To add an edge compute function to your service:
-
Navigate to your service.
-
In the sidebar, select Edge Compute.
-
Click the New button.
-
Fill in the new edge compute form:
- Name – Enter a name for the new edge compute function.
- Stages – Select the stage or stages of the request flow where the code should run:
- On Request – Triggered when the incoming HTTP request reaches the edge.
- On Response – Triggered after a response is generated but before it is returned to the end user.
- Code – Provide the code you want to deploy. For more details, review the Developer Guide.
- Add Route – Specify the routes (domain + path pattern) where the function should apply. Examples:
a.example.com/api/*– Applies the code to all requests under the domaina.example.commatching the path pattern/api/*.*/blogs/*– Applies the code to all service domains for requests matching the path pattern/blogs/*.
Once created, the new edge compute function will appear in the list, and take affect immediately.